﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddUserList.aspx.cs" Inherits="UserManagement_AddUserList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>批量录入用户</title>
    <link href="../Css/ys.css" rel="stylesheet" type="text/css" />
    <link href="../Css/auto.css" rel="stylesheet" type="text/css" />

    <script src="../Js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.json-2.2.min.js" type="text/javascript"></script>
        <script src="../Js/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="../Js/Core.js" type="text/javascript"></script>

    <script src="../Js/Main.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function SetSelectedValue(source, eventArgs) {
            var targetControlId = source.get_element().id;//得到textbox的id
            var index = targetControlId.substring(15, targetControlId.length); //获取行号
            var uInfo = eventArgs.get_value().split('|');

            document.getElementById('hidUserId' + index).value = uInfo[0];
            document.getElementById('txtLoginName' + index).value = uInfo[1];
            document.getElementById('txtMobile' + index).value = uInfo[2];
            document.getElementById('txtEmail' + index).value = uInfo[3];
            
            document.getElementById('txtUserRealName'+index).value = eventArgs.get_text().split(' ')[0];

        }
        function CheckUserValue() {
            return true;
        }
        function SetClassSelectedValue(source, eventArgs) {
            var targetControlId = source.get_element().id; //得到textbox的id
            var index = targetControlId.substring(20, targetControlId.length); //获取行号
            document.getElementById('hidTrainingClassId' + index).value = eventArgs.get_value();
        }

        function ChkDel(object) {
            var tabDetail = $("#list");
            var attendenceData = new Array();
            var trs = $("#list").find("tr");

            if (trs.length > 2) {
                $(object).parents('tr').remove();
                return;
            } else {
                alert("对不起，只剩最后一行不能删除了！");
                return;
            }
            //  $(object).parents('tr').remove()
        }
        $(document).ready(function() {
           
            var obj = $("#row").clone(true).appendTo("#list");
            obj.find("[DataField='VU_loginname']").attr({ id: "txtLoginName" + rond });
            obj.find("[DataField='spUsers']").attr({ id: "spUser" + rond });
            obj.find("[DataField='VU_mobile']").attr({ id: "txtMobile" + rond });
            obj.find("[DataField='txtEmail']").attr({ id: "VU_email" + rond });
            obj.find("[DataField='VU_loginname']").attr({ id: "txtUserRealName" + rond }); 
            $("#list").find("[DataField='rowhead']").attr({ id: "row" + 1 });
            obj.show(); 

        });


    </script>

     
</head>
<body>
    <form id="form1" runat="server">
    <div style="margin-left: 5px">
        <div class="title">
            批量录入用户</div>
        <div id="search" class="search">
            <table cellspacing="1" cellpadding="3" border="0">
                <tr>
                    <td class="noWrapTD" style="width: 130px">
                        培训班编号（唯一） ：
                    </td>
                    <td style="text-align: left; width: 100px">
                        <asp:Label ID="lblVTC_Number" runat="server"></asp:Label>
                    </td>
                    <td class="noWrapTD" style="width: 80px;">
                        培训班名称 ：
                    </td>
                    <td style="text-align: left; width: 100px;">
                        <asp:Label ID="lblVTC_name" runat="server"></asp:Label>
                    </td>
                    <td class="noWrapTD" style="width: 90px">
                        最大学员数量 ：
                    </td>
                    <td style="text-align: left; width: 280px">
                        <asp:Label ID="lblMaxUserCount" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="noWrapTD">
                        开课日期 ：
                    </td>
                    <td style="text-align: left">
                        <asp:Label ID="lblVTC_starDate" runat="server"></asp:Label>
                    </td>
                    <td class="noWrapTD">
                        截课日期 ：
                    </td>
                    <td style="text-align: left">
                        <asp:Label ID="lblVTC_endDate" runat="server"></asp:Label>
                    </td>
                    <td class="noWrapTD">
                        培训班描述 ：
                    </td>
                    <td onmouseover="this.title = this.innerText" style="text-align: left">
                        <div style="overflow: hidden; width: 270px; white-space: nowrap; text-overflow: ellipsis;"
                            runat="server" id="divVTC_desc">
                          </div>
                    </td>
                </tr>
            </table>
        </div>
        <br class="sp3px" />
        <table id="list" class="tab_alt" style="width: 95%" cellpadding="0" cellspacing="0">
            <tr class="header">
                <%--<td class="noWrapTD" style="width: 35px">
                    序号
                </td>--%>
                <%--<td class="noWrapTD">
                          培训班名称
                        </td>--%>
                <td class="noWrapTD">
                    学生姓名
                </td>
                <td class="noWrapTD">
                    <nobr>登录名/学号</nobr>
                </td>
                <td class="noWrapTD">
                    联系电话
                </td>
                <td class="noWrapTD">
                    Email
                </td>
                <td class="noWrapTD">
                   
                </td>
            
            </tr>
            <!--第一行 -->
            
            

           
        </table>
        <table>
        
         <tr id="row" class="template"  DataField="rowhead" style="display:none">
                <td>
                    <asp:TextBox ID="txtUserRealName" runat="server" CssClass="inp3" DataField="VU_realname" ></asp:TextBox>
                 <input type="hidden" runat="server" id="hfClassId" DataField="TrainingClassIdList" />
                </td>
                <td>
                <input type="text" id="txtLoginName" class="inp3"  DataField="VU_loginname"  onblur="VideoNetSchool.User.CheckUser(this.id,this.value);" />
<span id="spUser" DataField="spUsers"></span>                </td>
                <td>
                    <asp:TextBox ID="txtMobile" runat="server" CssClass="inp3" DataField="VU_mobile"></asp:TextBox>
                </td>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="inp3" DataField="VU_email"  onblur="VideoNetSchool.User.CheckUserEmail(this.id);"></asp:TextBox>
                </td>
                    <td>
                    <a href="javascript:;" onclick="ChkDel(this);">删除</a>
                </td> 
                
            </tr>
        </table>
        
       <input type="button" ID="btnAdd"   value="提交"  onclick="VideoNetSchool.User.SaveUser();" class="button"/>&nbsp;&nbsp;
        <input type="button" value="返回" onclick="window.history.go(-1)"
                        class="button" id="back" runat="server">&nbsp;&nbsp;<input type="button" value="增加" onclick="VideoNetSchool.User.AddRow()"
                        class="button" id="Button1" >
    </div>
    </form>
</body>
</html>
